LanguageExt.Sys

LanguageExt.Sys Sys

Contents

Sub modules

Diag
IO

class Console <M, RT> Source #

where M : StateM<M, RT>, Monad<M>
where RT : Has<M, ConsoleIO>

Time IO

Properties

property K<M, ConsoleKeyInfo> readKey Source #

Read a key from the console

property Producer<ConsoleKeyInfo, M, Unit> readKeys Source #

Read keys from the console and push them downstream

property K<M, Unit> clear Source #

Clear the console

property K<M, int> read Source #

Read from the console

property Producer<int, M, Unit> reads Source #

Read chars from the console and push them downstream

property K<M, string> readLine Source #

Read from the console

property Producer<string, M, Unit> readLines Source #

Read lines from the console and push them downstream

property K<M, Unit> writeEmptyLine Source #

Write an empty line to the console

property K<M, ConsoleColor> bgColor Source #

property K<M, ConsoleColor> color Source #

Methods

method K<M, Unit> writeLine (string line) Source #

Write a line to the console (returning unit)

method K<M, string> writeLine2 (string line) Source #

Write a line to the console (returning the original line)

method K<M, Unit> write (string line) Source #

Write a string to the console

method K<M, Unit> write (char line) Source #

Write a string to the console

method K<M, Unit> setBgColor (ConsoleColor color) Source #

method K<M, Unit> setColor (ConsoleColor color) Source #

method K<M, Unit> resetColor () Source #

class Enc <M, RT> Source #

where M : StateM<M, RT>, Monad<M>
where RT : Has<M, EncodingIO>

Properties

property K<M, System.Text.Encoding> encoding Source #

Encoding

class Environment <M, RT> Source #

where M : StateM<M, RT>, Monad<M>
where RT : Has<M, EnvironmentIO>

Environment IO

Properties

property K<M, string> commandLine Source #

Gets the command line for this process.

property K<M, int> currentManagedThreadId Source #

Gets a unique identifier for the current managed thread.

property K<M, int> exitCode Source #

Gets the exit code of the process.

property K<M, Seq<string>> commandLineArgs Source #

Returns a string array containing the command-line arguments for the current process.

property K<M, HashMap<string, Option<string>>> environmentVariables Source #

Retrieves all environment variable names and their values from the current process.

property K<M, Seq<string>> logicalDrives Source #

Returns an array of string containing the names of the logical drives on the current computer.

property K<M, bool> hasShutdownStarted Source #

Gets a value that indicates whether the current application domain is being unloaded or the common language runtime (CLR) is shutting down.

property K<M, bool> is64BitOperatingSystem Source #

Determines whether the current operating system is a 64-bit operating system.

property K<M, bool> is64BitProcess Source #

Determines whether the current process is a 64-bit process.

property K<M, string> machineName Source #

Gets the NetBIOS name of this local computer.

property K<M, string> newLine Source #

Gets the newline string defined for this environment.

property K<M, OperatingSystem> osVersion Source #

Gets an OperatingSystem object that contains the current platform identifier and version number.

property K<M, int> processorCount Source #

Gets the number of processors on the current machine.

property K<M, string> stackTrace Source #

Gets current stack trace information.

property K<M, string> systemDirectory Source #

Gets the fully qualified path of the system directory.

property K<M, int> systemPageSize Source #

Gets the number of bytes in the operating system's memory page.

property K<M, long> tickCount Source #

Gets the number of milliseconds elapsed since the system started.

property K<M, string> userDomainName Source #

Gets the network domain name associated with the current user.

property K<M, bool> userInteractive Source #

Gets a value indicating whether the current process is running in user interactive mode.

property K<M, string> userName Source #

Gets the user name of the person who is currently logged on to the operating system.

property K<M, Version> version Source #

Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.

property K<M, long> workingSet Source #

Gets the amount of physical memory mapped to the process context.

Methods

method K<M, Unit> exit (int exitCode) Source #

Terminates this process and returns an exit code to the operating system.

method K<M, Unit> setExitCode (int exitCode) Source #

Sets the exit code of the process.

Parameters

param exitCode

exit code of the process

method K<M, string> expandEnvironmentVariables (string name) Source #

Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string.

Parameters

param name

A string containing the names of zero or more environment variables. Each environment variable is quoted with the percent sign character (%).

method K<M, Unit> failFast (Option<string> message) Source #

Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message in error reporting to Microsoft.

Parameters

param message

A message that explains why the process was terminated, or null if no explanation is provided.

method K<M, Unit> failFast (Option<string> message, Option<Exception> exception) Source #

Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message and exception information in error reporting to Microsoft.

Parameters

param message

A message that explains why the process was terminated, or null if no explanation is provided.

param exception

An exception that represents the error that caused the termination. This is typically the exception in a catch block.

method K<M, Option<string>> getEnvironmentVariable (string variable) Source #

Retrieves the value of an environment variable from the current process.

Parameters

param variable

The name of an environment variable.

method K<M, Option<string>> getEnvironmentVariable (string variable, EnvironmentVariableTarget target) Source #

Retrieves the value of an environment variable from the current process or from the Windows operating system registry key for the current user or local machine.

Parameters

param variable

The name of an environment variable.

param target

Target

method K<M, HashMap<string, Option<string>>> getEnvironmentVariables (EnvironmentVariableTarget target) Source #

Retrieves all environment variable names and their values from the current process, or from the Windows operating system registry key for the current user or local machine.

Parameters

param target

One of the System.EnvironmentVariableTarget values. Only System.EnvironmentVariableTarget.Process is supported on .NET Core running on Unix-based systems.

method K<M, string> getFolderPath (Environment.SpecialFolder folder) Source #

Gets the path to the system special folder that is identified by the specified enumeration.

Parameters

param folder

One of enumeration values that identifies a system special folder.

method K<M, string> getFolderPath (Environment.SpecialFolder folder, Environment.SpecialFolderOption option) Source #

Gets the path to the system special folder that is identified by the specified enumeration, and uses a specified option for accessing special folders.

Parameters

param folder

One of the enumeration values that identifies a system special folder.

param option

One of the enumeration values that specifies options to use for accessing a special folder.

method K<M, Unit> setEnvironmentVariable (string variable, Option<string> value) Source #

Creates, modifies, or deletes an environment variable stored in the current process.

Parameters

param variable

The name of an environment variable.

param value

A value to assign to variable .

method K<M, Unit> SetEnvironmentVariable (string variable, Option<string> value, EnvironmentVariableTarget target) Source #

Creates, modifies, or deletes an environment variable stored in the current process or in the Windows operating system registry key reserved for the current user or local machine.

Parameters

param variable

The name of an environment variable.

param value

A value to assign to variable.

param target

One of the enumeration values that specifies the location of the environment variable.

class Time <M, RT> Source #

where M : StateM<M, RT>, Monad<M>
where RT : Has<M, TimeIO>

DateTime IO

Properties

property K<M, DateTime> now Source #

Current local date time

property K<M, DateTime> nowUTC Source #

Current universal date time

property K<M, DateTime> today Source #

Today's date

Methods

method K<M, Unit> sleepUntil (DateTime dt) Source #

Pause a task until a specified time

method K<M, Unit> sleepFor (TimeSpan ts) Source #

Pause a task until for a specified length of time